package com.evolution.warlock.excle;

import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Set;

public class GetFieldUtil {
	public static void main(String[] args) throws IOException {

//		Class cls = CivilDispute.class;
//		Field[] fields = cls.getDeclaredFields();
//		int i = 0;
//		for (Field field : fields) {
//			i++;
//			System.out.println(i + "  " + field.getName());
//		}
		
		Properties p = getProperties();
		//dump(p);
	}

	public static  Properties getProperties() throws IOException {
		Properties prop = new Properties();// 属性集合对象
		InputStream in = GetFieldUtil.class.getResourceAsStream("message_zh_CN.properties");
		//FileInputStream fis = new FileInputStream
		prop.load(in);// 将属性文件流装载到Properties对象中
		
		return prop;
	}
	
	
	public static void dump(Properties p){
		Enumeration e = p.elements();
		int i =0;
		while(e.hasMoreElements()){
			i++;
			Object obj = e.nextElement();
			//System.out.println(obj);
		}
		System.out.println(i);
		Set keys = p.keySet();
		int j=0;
		for (Object key : keys) {
			j++;
			System.out.println(key+ "     "+p.getProperty((String)key));
		}
		System.out.println(i+" "+j);
		
	}
}
